//
//  VIpViewController.m
//  groupProject
//
//  Created by mac on 15/12/31.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "VIpViewController.h"
#import "Config.h"
@interface VIpViewController ()

@end

@implementation VIpViewController{
    UILabel * labelName;
    UILabel * LevelLabel;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBarController.tabBar.hidden = YES;
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self addHeardView];
    [self addInformation];
    UILabel * tmpLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 300, SCREEN_WIDTH*0.5, SCREEN_HEIGHT*0.1)];
    tmpLabel.text =@"功能尚未完善还有待开发";
    tmpLabel.textColor = [UIColor blackColor];
    [self.view addSubview:tmpLabel];
}
-(void)addHeardView{
    UIView * view1 = [[UIView alloc]initWithFrame:CGRectMake(0, 49, SCREEN_WIDTH, SCROLL_HEIGHT)];
    //view1.backgroundColor = [UIColor purpleColor];
    [self.view addSubview:view1];
    
    UIImageView * tmpImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 50, 20, 20)];
    tmpImageView.image = [UIImage imageNamed:@"Cell_Vip.JPG"];
     [view1 addSubview:tmpImageView];
    
    //用户名文字
    labelName= [[UILabel alloc]initWithFrame:CGRectMake(50, 50, 150, 20)];
    labelName.textColor = [UIColor blackColor];
    [view1 addSubview:labelName];
    //用户等级
    LevelLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, 80, 100, 20)];
    
    [view1 addSubview:LevelLabel];
    
}
-(void)addInformation{
    NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
    NSString *name = [userDefault objectForKey:@"username"];
    NSNumber * level =[userDefault objectForKey:@"level1"];
    //labelName.text = name;
    labelName.text = [NSString stringWithFormat:@"%@@IphoneUser",name];
    
    LevelLabel.text = [NSString stringWithFormat:@"V%@会员",level];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
